Transparent multiplexing of analog-to-digital converters

ABSTRACT

A method and apparatus for sampling and converting analog input values. In response to an event, a value is transmitted from an input of a multiplexer to the output of the multiplexer. The output of the multiplexer is coupled to an input of an analog-to-digital converter (ADC). In response to a second event, a value is transmitted from the input of the multiplexer to a second ADC.

BACKGROUND

Modern control systems are growing in application and complexity. Thereare many classes of control systems, with many variations andcombinations. Some control systems generate signals that controlcomponents of a device. For example, some automobile engine controlsystems generate signals that directly or indirectly control variouscomponents (e.g., spark plugs, fuel injectors, and the like) of aninternal combustion engine. The present invention will be described withreference to an automobile engine control system, it being understoodthat the present invention should not be limited thereto.

The simplest engine control systems only control the timing and quantityof fuel injected into each cylinder during each cycle of the engine.More advanced engine control systems found in modern cars also controlignition timing, variable valve timing, the level of boost maintained bya turbo charger, etc. Using a complex set of algorithms, engine controlsystems can determine the quantity and timing of fuel injected intocylinders, ignition timing, and other needed parameters by monitoringthe engine through sensors that include, for example, a manifoldabsolute pressure sensor, throttle position sensor, air temperaturesensor, oxygen sensor, etc. In order to facilitate monitoring thesensors, the sensors' outputs should first be converted into digitalvalues.

SUMMARY

A method and apparatus for sampling and converting analog input values.In response to an event, a value is transmitted from an input of amultiplexer to the output of the multiplexer. The output of themultiplexer is coupled to an input of an analog-to-digital converter(ADC). In response to a second event, a value is transmitted from theinput of the multiplexer to a second ADC.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention may be better understood in its numerous objects,features, and advantages made apparent to those skilled in the art byreferencing the accompanying drawings. The use of the same referencesymbols in different drawings indicates similar or identical items.

FIG. 1 is a block diagram that illustrates relevant components of anexample engine control system, according to one embodiment.

FIG. 2 is a block diagram that illustrates relevant components of anexample analog-to-digital converter (ADC) system, according to oneembodiment.

FIG. 3 is a block diagram that illustrates relevant components of anexample command queue, according to one embodiment.

FIG. 4 illustrates relevant components of an example composite signal,according to one embodiment.

FIG. 5 is a block diagram that illustrates relevant components of anexample ADC system, according to one embodiment.

FIG. 6A illustrates relevant components of an example signal object,according to one embodiment.

FIG. 6B illustrates relevant components of an example status flagsregister, according to one embodiment.

FIG. 7 is a flow diagram that illustrates relevant aspects of theoperation of an ADC system, according to one embodiment.

FIG. 8 is a flow diagram that illustrates further relevant aspects ofthe operation of an ADC system, according to one embodiment.

FIG. 9 is a flow diagram that illustrates relevant aspects ofdecomposing a composite signal, according to one embodiment.

FIG. 10 is a block diagram that illustrates relevant components of anexample ADC system, according to one embodiment.

FIG. 11 is a flow diagram that illustrates relevant aspects of theoperation of an ADC system, according to one embodiment.

FIG. 12A is a block diagram that illustrates relevant components of anexample ADC system, according to one embodiment.

FIG. 12B is a block diagram that illustrates relevant components of anexample sample and hold circuit, according to one embodiment.

FIG. 13A is a timing diagram that illustrates relevant aspects of theoperation of an ADC system, according to one embodiment.

FIG. 13B is a timing diagram that illustrates relevant aspects of theoperation of an ADC system, according to one embodiment.

FIG. 14 is a flow diagram that illustrates relevant aspects of theoperation of an ADC system, according to one embodiment.

While the invention is susceptible to various modifications andalternative forms, specific embodiments of the invention are provided asexamples in the drawings and detailed description. It should beunderstood that the drawings and detailed description are not intendedto limit the invention to the particular form disclosed. Instead, theintention is to cover all modifications, equivalents and alternativesfalling within the spirit and scope of the invention as defined by theappended claims.

DETAILED DESCRIPTION

FIG. 1 is a block diagram that illustrates relevant components of anexample engine control system 110. As illustrated, the engine controlsystem includes one or more processors 120 (e.g., microprocessors,programmable logic devices (PLDs), or application specific integratedcircuits (ASICs)) configured to execute program instructions stored inmemory 130. Memory 130 can include various types of random access memory(RAM), read only memory (ROM), flash memory, micro electro-mechanicalsystems (MEMS) memory, magnetic core memory, and the like. Memory 130can include both volatile and non-volatile memory. Engine control system110 also includes one or more interfaces 140. Interface 140 can includea network interface to various networks and/or interfaces to variousperipheral buses. Processor 120, memory 130, and interface 140 arecoupled to send and receive data and control signals by communicationlink 165, which can include a bus, switching fabric, bridge, directmemory access controller, and the like. In one embodiment, thecomponents of engine control system 110 can be integrated. In anotherembodiment, the components of engine control system can be implementedoff-chip.

As illustrated, engine control system 110 also includes ADC system 150(described below.) Engine control system 110 is shown coupled to anautomobile engine 160. Engine 160 includes one or more sensors 170 thatcan be configured to detect various operational characteristics ofengine 160, as described below.

In general, a control system (e.g., engine control system 110 of FIG. 1)is designed to regulate, or control some parameter (e.g., fuel/air mixratio sent to an engine's cylinder). Typically the control system isdesigned to keep the value of the parameter at or near a given setpoint.In order for a control system to control a given parameter the controlsystem typically monitors one or more “real-world” values. The value(s)monitored by the control system provides feedback as to how close to thegiven setpoint the parameter is. Based on the monitored value(s), thecontrol system can detect and adjust operating characteristics of thecontrolled system. The effect of these adjustments can be detected bycontinuing to monitor the “real-world” value(s).

For example, engine control system 110 can monitor the output of one ormore of sensors 170. Sensors 170 can include, for example, an oxygensensor. An oxygen sensor can detect the amount of oxygen in engine 160'sexhaust and produce an output voltage value that is proportional to theamount of oxygen detected. Engine control system 110 can detect whetherthe fuel/air mixture in one or more of engine 160's cylinders (notshown) is too lean or too rich based on the oxygen sensor's outputvoltage value. For example, engine control system 110 can indirectlycompare the oxygen sensor's output voltage value with a predefinedvoltage value or range of voltage values that indicate an optimalfuel/air mixture ratio. If the oxygen sensor's output voltage value isabove or below the optimal or target range, the mixture should beadjusted. Processor 120 can calculate a desired adjustment to theparameter and issue a command to engine 160 to adjust the parameter. Ifthe oxygen sensor's output voltage value indicates that the fuel/airmixture is too lean or too rich, engine control system 110 can adjustthe mixture, for example by signaling the fuel injection system (notshown) to increase or decrease the amount of fuel injected into thecylinder. By continuing to monitor the oxygen sensor's output voltagevalue, engine control system 110 can detect whether the adjustment hashad the desired effect of bringing the oxygen sensor's output voltagevalue within the target range or if further adjustment to the mixture isrequired. While the oxygen sensor discussed in this example outputs avoltage, other types of sensors or sources may produce outputs that aremeasured in other terms, e.g., current.

A sensor's output voltage value (e.g., one of sensors 170) is typicallyan analog voltage value that can be transmitted to and measured at ananalog input pin. Engine control system 110 can include a number ofanalog input pins from which engine control system 110 can read analoginput values in order to detect a number of different engine performancecharacteristics. Reading an analog input value from an analog input pinis known as sampling the analog input value. The number of analog inputpins available to the engine control system is typically quite limited.Adding additional analog input pins to an engine control system can becost prohibitive or may be difficult or impossible due to limited enginecontrol system resources (e.g., processor resources). Accordingly, thereis great pressure to utilize the limited number of analog input pins aseffectively as possible.

In order for engine control system 110 to use the “real world”information represented by the analog input values sampled from enginecontrol system 110's analog input pins, the analog input values aretypically converted to digital values that can more easily bemanipulated by processors, such as processor 120 of FIG. 1. Enginecontrol system 110 includes analog-to-digital converter (ADC) system 150which can convert the sampled analog input values to digital values.

FIG. 2 is a block diagram that illustrates relevant components of anexample ADC system, according to one embodiment. ADC system 150 includesone or more ADCs, such as ADCs 250. An ADC 250 can convert an analogvalue into a digital representation of that value. ADC system 150 alsoincludes ADC control logic 230. ADC control logic 230 can control ADC250's conversion of an analog input value into a digital representationof that value. ADC system 150 receives analog input values on one ormore analog input pins and then converts the analog input values intodigital representations. The digital representations can be stored inresult buffers 210. Result buffers 210 can be stored in memory, such asmemory 130 of FIG. 1.

In one embodiment, sensors, such as sensors 170 of FIG. 1, produceoutput voltage values that are fed into ADC system 150 as analog inputvalues. An analog input pin can be coupled to an output of a sensor orany other source for analog input values. For example, an analog inputpin can be coupled to an oxygen sensor for an automobile engine, such asengine 160 of FIG. 1. The oxygen sensor can output an analog voltagevalue, for example, an analog voltage value between 0 and 5V. The analogvoltage value output by the oxygen sensor is transmitted to an analoginput pin coupled to the oxygen sensor, where the analog voltage valueis known as an analog input value. In one embodiment, the analog voltagevalue output by the oxygen sensor can be amplified, for example by anamplifier (not shown), prior to arriving at an analog input pin. In oneembodiment, a filter mechanism (not shown) can be included between theanalog input pin and the oxygen sensor. A filter can be used, in oneimplementation, to protect sensitive analog input components frompotentially damaging analog voltage value spikes. In another embodiment,a filter can remove noise from an analog input voltage produced by anoxygen sensor. The analog input value can change, i.e., the analog inputvalue measured on an analog input pin at a first time may be differentfrom the analog input value measured on the analog input pin at a secondtime. In the example of an analog input value supplied by an oxygensensor, the analog input value varies proportionally with the level ofoxygen detected by the oxygen sensor.

In an example case, the ADC system measures an analog input value of2.52V on the analog input pin at a first time. In this example, themeasurement of the analog input value is precise to two digits, or to ahundredth of a volt. If more precise measurements are desired, moresophisticated components (e.g., analog-to-digital converters and/orsensors) can be used. For example, if more sophisticated components areused for the above measurement, it may be seen that the analog inputvalue is actually 2.5189V. For this example, 2.52V is used as the analoginput value. If the ADC system measures an analog input value of 4.25Vat a second time, the oxygen sensor detected more oxygen at the secondtime.

An analog input value can be converted to a digital representation byassigning the analog input value to one of a plurality of digital valuesavailable from an ADC converter. The number of possible digital valuesan ADC can assign is known as the ADC's resolution. For example, an8-bit converter has 2⁸ (256) possible digital values. That is, an 8-bitADC can assign 256 different digital values for the range of analoginput values the ADC capable of handling. In one example, an ADC iscapable of handling input values between 0 and 5V. The input voltagecapability of an ADC is typically specified by the ADC's manufacturer.

Table 1 shows a mapping of analog input values between 0 and 5V to 8-bitdigital values. In this example, an analog input value of 2.52Vcorresponds to an 8 bit digital value of 10000001. The higher an ADC'sresolution, the more digital values that can be assigned over the samerange of analog input values. For example, a 12-bit ADC can assign 4096different (12 bit) digital values. It can be seen that higher resolutionADCs can provide greater precision in representing an analog input valuewith a digital values. Generally, ADCs with higher resolution are largerand more expensive.

TABLE 1 Mapping of analog input values to digital values for a typical8-bit ADC. Analog Value 8-bit Digital Value 0   00000000 0.02 000000010.04 00000010 0.06 00000011 . . . . . . 2.5  10000000 2.52 10000001 2.5410000010 . . . . . . 4.96 11111101 4.98 11111110 5   11111111

An ADC system (such as ADC system 150 of FIG. 2) can include multipleADCs and concurrently receive analog input values from multiple sourcesor sensors. Each ADC in an ADC system can convert one analog input valueto a digital value at a time. Ensuring that analog input values from allof a control system's analog input pins are sampled and converted in atimely manner is a primary objective in the design of an ADC system andcan be a significant challenge.

One way ADC system designers can attempt to meet this challenge involveslogically grouping analog input pins. Grouping an ADC system's analoginput pins allows designers to specify a single set of conversionparameters that apply to all the analog input pins in a group. Groupingan ADC system's analog input pins effectively (in order to maximize ADCsystem resource utilization) can be an intricate task. Designers spendsignificant time and effort determining how to group an ADC system'sanalog input pins. Factors to consider when grouping an ADC system'sanalog input pins include the number of analog input pins in the ADCsystem, the number of ADCs in the ADC system, and the ADC bandwidthrequirements for each analog input pin (e.g., how frequently analoginput values must be sampled from each analog input pin), as well asother conversion configuration parameters for each analog input pin(e.g., the priority and the trigger mechanism of each analog input pin).

Some ADC systems provide one or more command queues, such as commandqueue 205 of FIG. 2, for each group of analog input pins. A commandqueue specifies conversion configuration parameters (described below)for its group of analog input pins. Each analog input pin in the groupis subject to the conversion configuration parameters specified by thecommand queue. Grouping the analog input pins in this way means thatsystem designers can specify fewer sets of conversion configurationparameters. Instead of having to designate a set of conversionconfiguration parameters for each of an ADC system's analog input pins,designers need only designate a set of a set of conversion configurationparameters for each of the ADC system's command queues. Usually thereare significantly fewer command queues than analog input pins.

FIG. 3 is a block diagram that illustrates relevant components of anexample command queue, according to one embodiment. A command queue,such as command queue 205 of FIG. 3, identifies one or more analog inputpins and conversion configuration parameters that apply to the analoginput pins. For example, a command queue can identify the analog inputpins by including a list of analog input pins, such as list 300 of FIG.3. Examples of conversion configuration parameters that can beidentified by a command queue include a trigger, such as trigger 310 ofFIG. 3, a priority, such as priority 320 of FIG. 3, and the location ofone or more result buffers, such as result buffer locations 330 of FIG.3.

A trigger, such as trigger 310 of FIG. 3, can be used to signify when ananalog input value from one or more analog input pins should be sampled.ADC control logic initiates sampling on the occurrence of a trigger. Atrigger can be periodic (i.e., the trigger occurs on a periodic basis).In other embodiments, a trigger can be a one time trigger, anevent-driven trigger, or other type of non-periodic trigger. A periodictrigger can occur, for example, when a certain time period expires. Inone embodiment, the trigger occurs based on an output value of asequential counter. In one example, the counter increments by 1 witheach cycle or half cycle of a square wave clock signal input. Thecounter begins at 0 and increments by 1 with each full or half clockcycle until the counter reaches a predetermined value (e.g., 0xFFFF).Thereafter the counter returns to 0 and continues incrementing. It isnoted that the clock signal used by the counter may be a system clockprovided to and used by each of the components of ADC system 110, shownin FIG. 2. In one embodiment, a trigger can be programmed to occur eachtime the value of the counter reaches, for example, 0xFF00. The timeperiod of the trigger can be calculated as a time value by multiplyingthe value of the counter at which the trigger specifies a sample by thelength of time in each clock cycle. For example, if the clock frequencyis 1 MHz, a trigger set to initiate a sample when the counter reaches0xFF00 initiates a sample approximately every 65 milliseconds. Multipleperiodic triggers can be configured to occur at multiple values of thesequential counter. For example, in addition to programming a trigger tooccur when the counter reaches 0xFF00, additional triggers can beprogrammed to occur at other values of the counter, e.g., every 50increments of the counter.

In another embodiment, a trigger can occur when a certain enginerotation angle occurs. An engine rotation angle relates to an angularposition of an engine cycle at a given time and can be generated as afunction of a variable reluctance sensor (not shown) output. A number ofequally-spaced and equally-sized teeth are formed around a crankshaftflywheel (not shown); two (or more) of the teeth, however, have adifferent distance between them. A sensor is located in proximity andsenses the teeth as they pass. A processor (such as processor 120 ofFIG. 1) generates a predetermined number of “ticks” between sensed teethbased on the sensor output. These ticks may have a resolution of 0.1degree, 0.25 degree, 0.5 degree, etc., of crankshaft rotation. When atooth is sensed, the period from the just previously sensed tooth isused to generate ticks for the currently sensed tooth. Sinceacceleration and deceleration of the crankshaft can cause a tooth periodto be longer or shorter than the previous tooth period, the processerensures the correct number of ticks is produced for each tooth. This isdone by incrementing ticks quickly or by stopping them until the nexttooth is sensed. The two teeth that have a different distance betweenthem, as noted above, are used as a reference point to identify a fullrotation of the crankshaft.

The ticks are provided to an angle reference value generator (not shown)that generates an angle reference value. The angle reference valuegenerator increments by 1 for each tick until the counter reaches apredetermined value (e.g., 0xFFFF). Thereafter the counter returns to 0and continues incrementing. When the crankshaft speed of rotationincreases or decreases, the rate at which the reference value incrementsincreases or decreases proportionally. To illustrate, assume thecrankshaft rotates at a faster speed during a first time period whencompared to a second time period. During the first time period, thereference value increments at a rate that is greater than the rate atwhich it increments during the second time period. A trigger can beprogrammed to initiate a sample of one of the pins listed in a commandqueue based on the reference value, or based on the value of thecounter. For example, a trigger can occur each time the counter reaches,for example, 0xFF00. In this example, the period (in degrees) of thetrigger can be calculated by multiplying the value of the counter atwhich the trigger specifies a sample by the resolution of the ticks. Forexample, if the resolution of the ticks is 1 tick per 0.5 degree ofcrankshaft rotation, a trigger set to occur when the counter reaches0xFF00 does so every 32640 degrees of crankshaft rotation, orapproximately every 90 rotations of the crankshaft.

An event driven trigger is a trigger that is configured to occur if aspecific event is detected. For example, a trigger can be configured tooccur if current in a coil (e.g., a charging coil that provides energyused by a spark plug for creating a spark within an engine cylinder)exceeds a threshold value. The value of coil current can be detected bya coil current sensor in the engine.

A command queue's trigger determines when analog input values aresampled from each analog input pin listed in the command queue. Thefrequency at which sampling is initiated for each analog input pin isknown as the analog input pin's sample rate. Sample rate depends on thefrequency of the occurrence of the command queue's trigger.

ADC control logic, such as ADC control logic 230 of FIG. 2, candetermine which analog input value to process (sample and convert), ifanalog input values from analog input pins identified by more than onecommand queue require sampling concurrently. ADC control logic can usethe priorities of the respective command queues to determine the orderin which to sample analog input values. For example, if the trigger fora first command queue occurs simultaneously with the trigger for asecond command queue, an analog input value should be sampled andconverted from an analog input pin identified in each of the first andsecond command queues. If insufficient ADC bandwidth exists at the timeto convert both analog input values simultaneously, ADC control logicmust determine which of the command queues has a higher priority. In anADC system having only one ADC and one sample module, only one analoginput value at a time can be processed (sampled and converted). In thiscase, ADC control logic determines which of the two command queues has ahigher priority. An analog input value from an analog input pin of thecommand queue with the higher priority is processed first.

Command queue 205, as illustrated in FIG. 3, also includes a pointer305. Pointer 305 points to an analog input pin in list 300 from whichADC system 150 will next sample an analog input value. Each time atrigger associated with command queue 205 occurs, ADC control logic 230initiates a sample of the first analog input pin included in list 300and updates pointer 305 to point to the next analog input pin identifiedin list 300. Once the first analog input pin is sampled, the next analoginput pin identified in list 300 is sampled and ADC control logic againupdates pointer 305 to point to the next analog input pin identified inlist 300, and so on until each pin identified in list 300 has beensampled. At that point, control logic 230 updates pointer 305 to pointto the first analog input pin identified in list 300. When a triggerassociated with command queue 205 occurs again, the process describedabove can be repeated.

As illustrated, ADC system 150 of FIG. 2 includes two multiplexers 220,two sample modules 240, and two ADCs 250. It is noted that in otherembodiments, ADC system 150 may include more or fewer multiplexers,sample modules, and ADCs. Sample modules 240 can read (sample) an analoginput value from the ADC system's analog input pins and can also store asampled analog input value. In response to a trigger occurring, one ofsample modules 240 can sample an analog input value from one of theanalog input pins identified in a command queue 205. Once one of samplemodules 240 samples the analog input value is sampled, the sample modulecan store the analog input value. An ADC 250 can read the analog inputvalue from the sample module 240 and convert the analog input value to adigital value.

Typically ADC control logic 230 of FIG. 2 initiates a sampling inresponse to the occurrence of a trigger, such as trigger 310 of FIG. 3.Initiation of a sampling can include selecting an analog input pin basedon the position of command queue pointer 305 of FIG. 3, relative to thelist of analog input pins 300 of FIG. 3. Once ADC control logic 230 hasselected an analog input pin, ADC control logic 230 can send a controlsignal to the control input of a multiplexer, such as one ofmultiplexers 220 of FIG. 2. Multiplexers 220 are shown having inputs 1through N. It will be noted that the variable identifier “N” is used tomore simply designate the final element (e.g., input N) of a series ofrelated or similar elements. The repeated use of such variableidentifiers is not meant to imply a correlation between the sizes ofsuch series of elements, although such correlation may exist. The use ofsuch variable identifiers does not require that each series of elementshas the same number of elements as another series delimited by the samevariable identifier. Rather, in each instance of use, the variableidentified by “N” may hold the same or a different value than otherinstances of the same variable identifier.

Based on a control signal received from ADC control logic 230, amultiplexer 220 can select one of the analog input pins 1 through Nconnected to the inputs of the multiplexer 220. For example, if acommand queue pointer indicates (e.g., by pointing to the analog inputpin the command queue list of analog input pins) that the next analoginput pin from which an analog input value is to be sampled from is thethird pin of an 8-input multiplexer, ADC control logic can send acontrol signal that corresponds to the third pin to the multiplexer.Table 2 shows one example of control signals and corresponding inputselections for an 8-input multiplexer. Generally, more control signalbits are required for multiplexers having more input pins. For example,a system having between 33 and 64 inputs would require 6 bits of controlinput to select one of the input pins, while a system having between 17and 32 input pins would only require 5 bits of control signal to selectone of the input pins. Once the multiplexer receives a control signalselecting one of the analog input pins, the multiplexer can pass ananalog input value from the selected analog input pin to the output ofthe multiplexer.

TABLE 2 Multiplexer input selections. Control Pin 000 0 001 1 010 2 0113 100 4 101 5 110 6 111 7

As illustrated in FIG. 2, the output of a multiplexer 220 is connectedto sample module 240. Sample module 240 is coupled to ADC control logic230 and to an ADC 250. The sample module 240 stores a sampled analoginput value until ADC 250 converts the analog input value to a digitalvalue. At that point, the sample module 240 transmits the analog inputvalue to the input of the ADC 250, which is shown coupled to samplemodule 240, can read an analog input value from sample module 240 andconvert the analog input value to a digital value.

The sequence of steps to convert an analog input value can include someor all of the following: a command queue's trigger occurs; ADC controllogic determines from which of the analog input pins listed in thecommand queue an analog input value is to be read; ADC control logicsends a control signal to a multiplexer to select the analog input pin;the multiplexer passes an analog input value from the selected analoginput pin to the sample module; an ADC reads the analog input value fromthe sample module; the ADC converts the analog input value to a digitalvalue; the ADC transmits the digital value to a result buffer andtransmits a conversion complete signal to the ADC control logic.

Grouping analog input pins into a list where analog input values fromeach analog input pin in the list are sampled based on the same triggerhas a number of potential drawbacks. One problem that can arise is whenan analog input signal on an analog input pin requires a sample ratethat is not provided by any of the ADC system's command queues. In thecase in which none of the ADC system's command queues specifies a samplerate that is identical to the needed sample rate, the analog input pinmust be listed in a command queue that has a sample rate that is eitherfaster or slower than the needed sample rate.

For example, consider a system that has two command queues, a first ofwhich identifies a trigger that occurs every 10 milliseconds. Every 10milliseconds, a process of sampling an analog input value from each ofcommand queue's analog input pins (sequentially) is initiated. Thesecond command queue identifies a trigger that occurs every 20milliseconds. If an analog input pin in the ADC system requires a samplerate of 100 milliseconds (i.e., an analog input value must be sampledfrom the analog input pin every 100 milliseconds), a determination mustbe made which command queue to list the analog input pin in. The analoginput pin must be listed in either the command queue with the 50millisecond sample rate or in the command queue with the 200 millisecondsample rate if the ADC system of FIG. 1 does not allow specifying atrigger for each individual analog input pin.

In the ADC system of FIG. 2, each analog input pin must be identified inat least one of the ADC system's command queues. Thus all analog inputpins have a sample rate that is a function of the frequency ofoccurrence of the trigger of the command queue in which the analog inputpin is listed. If the analog input pin with the desired sample rate of 1sample per 100 milliseconds is listed in the first queue, an analoginput value will be sampled from the analog input pin more frequentlythan is needed. This extra sampling is an unnecessary burden on theengine control system and reduces the efficiency of the engine controlsystem by using resources to sample analog input values from an analoginput pin at times when the analog input values do not need to besampled. This extra sampling also results in wasted ADC bandwidth in theform of unnecessary conversions. If, on the other hand, the analog inputpin is listed in the second queue, analog values will be sampled fromthe analog input pin too infrequently and important analog input valuesare not sampled from the analog input pin.

Another problem that can result from grouping analog input pins intocommand queues, as in the ADC system of FIG. 2, is evident whenconsidering composite signals. A composite signal is a type of analoginput signal. A composite signal includes multiple source signals thatcreate a single analog waveform on a single analog input pin. Forexample, the multiple source signals can each be present on the analoginput pin at separate times. Thus, multiple source signals are timemultiplexed onto a single analog input pin. A source signal refers to ananalog input signal generated by a sensor (e.g., an oxygen sensor) orthe like. A source signal is made up of the analog output values from asensor. An analog input signal can consist of a single source signal.Alternatively, an analog input signal can consist of multiple sourcesignals. In the latter case, the analog input signal is known as acomposite signal. In one embodiment, a single sensor output can includemultiple signals of interest. The multiple signals of interest can bemade available on a single analog input pin as a composite signal orcoupled to multiple analog input pins.

The term analog input signal, when used in the context ofanalog-to-digital conversion, is used to refer to an analog waveformthat can be produced by sampling two or more output values of a sensor.The sensor output values are available to be sampled as analog inputvalues at an analog input pin. An analog input signal can be representedgraphically by plotting several sampled analog input values over time.That is, several sampled analog input values are plotted on the verticalaxis of a graph and the times at which the analog input values weresampled are plotted on the horizontal axis of the graph.

One example of an analog input signal is a knock signal. An enginecontrol system, such as engine control system 110 of FIG. 1, can detectengine knock by monitoring a knock signal. Engine knock refers topremature detonation of engine fuel ahead of the normally scheduledcombustion that occurs in an engine's combustion chamber (e.g.,cylinder). An engine typically has a knock sensor to detect suchpremature detonation. The knock sensor outputs different voltage levelswhen the engine is knocking from when the engine is not knocking. Theknock sensor output can include a specific characteristic frequency,observable when the engine is knocking, but not when the engine is notknocking. The voltage produced by the knock sensor is available on agiven analog input pin, allowing the observation of a knock signal onthe given analog input pin.

By sampling analog input values from the given analog input pin during aparticular period of time, an engine control system can detect whetherthe engine is knocking. In order to detect engine knock, the enginecontrol system can convert the analog input signal (knock signal) to aseries of digital values. These digital values can be analyzed by aprocessor which detects whether the engine is knocking. If the enginecontrol system detects that the engine is knocking, the engine controlsystem can adjust various engine parameters (e.g., ignition timing, fuelinjection) to alleviate the knocking.

FIG. 4 illustrates relevant components of an example composite signal,according to one embodiment. Composite signal 400 includes informationabout coil current, knock, and misfire (misfire refers to the failure offuel to properly ignite in an engine's combustion chamber). Multiplesource signals can be made available on a single analog input pin bycoupling multiple sensors to a single analog input pin. The output ofeach sensor is time multiplexed onto the analog input pin for aspecified window of time. For example, during a first window of time,the output of a first sensor can be coupled to the analog input pin.During a second window of time, the output of the first sensor can bedisconnected from the analog input pin and the output of a second sensorcan be coupled to the analog input pin. In one embodiment, multiplesource signals can be generated by a single sensor. For example, asingle sensor can generate a knock signal during one window of time anda misfire signal during another window of time. One reason to includemultiple source signals on one analog input pin is to allow more sourcesignals to be monitored on fewer analog input pins. Engine controlsystems are limited in the number of analog input pins that areavailable. Adding more analog input pins can require expensive systemredesign and is not feasible above a certain number.

Decomposition of a composite signal refers to a process of extractingthe various pieces of information from the composite signal, orseparating the multiple source signals that form the composite signal.Once the various source signals are separated, the engine control systemcan use the source signals to control various engine operatingcharacteristics. FIG. 4 illustrates a coil current window 405, misfirewindow 415, knock window 420, and a blank period 410. Source signalscorresponding to the respective windows are available on an analog inputpin during the respective windows. For example, during the coil currentwindow, a coil current source signal is available on the analog inputpin. Any other sensors coupled to the analog input pin are blocked fromtransmitting analog input values onto the analog input pin during thecoil current window. During the blank period, no source signal isavailable on the analog input pin.

In the example of FIG. 4, decomposing composite signal 400 involvesseparating the coil current, misfire, and knock signals from oneanother. The ADC system of FIG. 2 is not designed to effectivelydecompose composite signals. In order to decompose a composite signal,the ADC system of FIG. 2 may be required to sample at higher thannecessary rates, perform extensive sorting of conversion result data,and use additional analog input pins, all of which are burdens onprocessing and memory resources of an engine control system.

The ADC system of FIG. 2 provides only one trigger for each commandqueue. Each analog input pin listed in the command queue has the sametrigger, i.e., the command queue's trigger, and the command queue'strigger indicates when analog input values are sampled from each analoginput pin listed in the command queue. A trigger can include informationthat specifies when an analog input value should be sampled from ananalog input pin listed in the command queue, such as frequencyparameters (e.g., sample an analog input value from an analog input pinevery 10 milliseconds) and event parameters (e.g., sample an analoginput value from an analog input pin 100 microseconds after the enginecontrol system detects coil current exceeds a predetermined thresholdvalue). Analog input values are sampled from each analog input pinlisted in the command queue according to the trigger configurationinformation for the command queue.

In the case of a composite signal, which is composed of multiple sourcesignals (which can be generated either by a single sensor or multiplesensors), a command queue's limitation of only one trigger can lead toinefficient use of ADC resources when attempting to decompose thecomposite signal. For example, a higher sample rate may be required forone of the source signals of the composite signal than the sample raterequired for other source signals of the composite signal. If a commandqueue's trigger specifies a sample rate fast enough to capture therequired data for the source signal having the higher rate, the samplerate will be higher than is needed for other source signals. This leadsto over sampling, or sampling (and converting) of analog input values attimes when no sampling is actually desired.

For example, during the knock window 420 of FIG. 4, the sample rate isrequired to be relatively high (e.g. 100-200 kilohertz) because frequentsamples are required to determine if the engine is knocking. During themisfire window 415 of FIG. 4, less frequent sampling is required (e.g.10-20 kilohertz) because misfire can be detected with less frequentsampling. However, since the ADC system of FIG. 2 only specifies onesample rate per analog input pin, or one trigger configuration percommand queue, the ADC system of FIG. 2 is unable to adjust for thisdifference. The ADC system of FIG. 2 lacks the capability of specifyingmultiple sample rates for a given analog input pin listed in a commandqueue. Thus, if the sample rate is high enough to capture all therequired analog input values during the knock window, the sample rate isunnecessarily high during the misfire window, resulting in unneededsamples. The ADC system requires more memory to store all these unneededsamples as well as faster, more expensive ADCs to convert the extrasamples. The inability to specify multiple sample rates for a givenanalog input pin results in a less efficient system overall.

In the ADC system of FIG. 2, each command queue includes a list ofmemory location addresses. Each address identifies a location in memorywhere conversion results are stored. These memory locations are known asthe ADC system's result buffers. For each analog input pin listed in thecommand queue, there is a corresponding memory location (result buffer)address listed in the command queue. Once a given analog input pin issampled, and the analog input value converted to a digital value by anADC, the digital value is stored in the result buffer that correspondsto the given analog input pin. An engine control system processor canread the digital value from the result buffer and process the digitalvalue in performing engine system control functions. For example, if ananalog input value is to be sampled from an analog input pin everymillisecond for 1.5 seconds, the result buffers will store 1500 digitalvalues, each digital value being the digital representation of theanalog value present on that analog input pin at each millisecond duringthe 1.5 second interval.

One consequence of the ADC system of FIG. 2 having only a singleconfiguration for each analog input pin is that the conversion resultsfor that analog input pin (digital representations produced by an ADC ofthe sampled analog input values) are sent to the same result buffer,i.e., the result buffer that corresponds to the analog input pin, asspecified by the command queue's list of memory location addresses. Inthe case of a composite signal, the engine control system is required tosort out the conversion results that correspond to the individual sourcesignals so that the results for each individual source signal can beused by the various portions of the engine control system. For example,if knock and misfire analog input values are sampled from the sameanalog input pin, the digital values corresponding to the knock andmisfire signals will both be stored in that analog input pin's resultbuffer. The engine control system must separate the knock sensor valuesfrom the misfire sensor values so that only knock sensor data is usedwhen determining whether the engine is knocking. If the engine controlsystem attempted to use the conversion results without first separatingthe various signal results, the results could be unpredictable. Forexample, using knock signal data mixed with misfire data to determine ifthe engine was knocking could result in errors and ineffective enginecontrol by the engine control system.

Also, as noted above, if the ADC system sampled at too high a rateduring the misfire window, some of the misfire conversion results arenot needed and must be discarded. Separating the conversion results forvarious source signals and determining which results are needed andwhich should be discarded is known as post-processing. Post-processingcan include a processor, such as processor 120 of FIG. 1, in the enginecontrol system determining when the analog input values corresponding toeach digital value were sampled by analyzing the trigger configurationof the command queue associated with the result buffer. The processorcan then select digital values that correspond to analog input valuesthat were sampled during the relevant time periods (e.g., during theknock window). Once the locations in the result buffer that storeconversion results for each of the various signals are identified, theconversion results can be transferred from those locations to otherparts of the engine control system for use in controlling the engine.For example, the knock signal conversion results can be evaluated by theengine control system, and if a knock condition is detected, the enginecontrol system can adjust engine parameters to attempt to alleviate theknocking.

Post-processing is a burden on engine control system processingresources and can reduce the speed and efficiency of the engine controlsystem. When the processor needs to use, for example, knock sensor data,the processor in this embodiment cannot simply go to a knock sensor dataresult buffer and read the values in the result buffer. In theembodiment illustrated in FIGS. 2 and 3, there is not a result bufferthat exclusively contains data for each signal. Instead, result buffershave conversion results from multiple signals mixed together. As aresult, the processor must spend cycles locating the desired data, whichcan delay the processor's performance of other tasks.

In some cases, a composite signal may be routed to more than one analoginput pin in an attempt to mitigate some of the issues discussed above.The analog input pins to which the composite signal is routed can beincluded in different command queues, the different command queueshaving different triggers and different result buffers. Listing thecomposite signal's analog input pin in multiple command queuesalleviates the problem of sampling at a single rate for multiple signalson a single analog input pin by providing multiple sample rates for theanalog input pins.

Consider a composite signal composed of two source signals. A firstsource signal of the composite signals requires conversion at a firstsample rate. A second source signal of the composite signal requiresconversion at a second sample rate. The composite signal can be routedto two analog input pins listed in different command queues from eachother. The first command queue (the command queue that lists a first ofthe two analog input pins) has a trigger that initiates samples ofanalog input values from one of the analog input pin to which thecomposite signal is routed at the first sample rate. When the firstcommand queue's trigger occurs, an analog input value is sampled fromthe analog input pin listed in the first command queue. The sampledanalog input value is converted to a digital value and stored in theresult buffer specified by the first command queue. The second commandqueue has a trigger that initiates samples of the other analog input pinto which the composite signal is routed at the second sample rate. Whenthe second command queue's trigger occurs, an analog input value issampled from the analog input pin listed in the second command queue.The sampled analog input value is converted to a digital value andstored in the result buffer specified by the second command queue. Inthis way the same composite signal is sampled at two different samplerates and the conversion results stored in two different result buffers.

An engine control system processor can read the digital values from theresult buffers. Since the digital values in each result buffer resultfrom samples of the composite signal, the digital values in each resultbuffer represent conversion results for two source signals. Theprocessor needs to separate the conversion results for the first sourcesignal from the conversions results for the second source signal, sothat the results can be used to control various engine parameters. Inorder to determine which conversion results correspond to the firstsource signal and which conversion results correspond to the secondsource signal, the processor can detect the time during which the analoginput values that produced the conversion results were sampled. Forexample, if the first source signal of the composite signal is onlyvalid between a first time and a second time, the processor can selectconversion results stored in the first result buffer that correspond toanalog input values sampled from the analog input pin between the firstand second times. If the second signal is valid only between a thirdtime to a fourth time, the processor can select conversion resultsstored in the second result buffer that correspond to analog inputvalues sampled from the analog input pin between the third and fourthtimes.

In this way, the first source signal is sampled at the sample ratedesired for the first source signal and the second source signal issampled at the sample rate desired for the second source signal. Havingtwo or more sample rates for a composite signal alleviates the problemof sampling too frequently or too infrequently for at least one sourcesignal of a composite signal where the multiple source signals requiredifferent sample rates. However, in order to specify multiple samplerates, the ADC system of FIG. 2 must use multiple analog input pins andmultiple result buffers. This additional use of resources is undesirablesince the memory and number of analog input pins is limited in most ADCsystems.

Furthermore, the processor is required to differentiate between theconversion results in each result buffer that correspond to the analoginput values for the source signal being captured by the command queuecorresponding to each result buffer since each result buffer will alsocontain data for all of the source signals. This need to determine whichconversion results correspond to which source signal is an additionalprocessing burden on the processor, which also has limited processingresources available.

Adding additional analog input pins, memory, and processing power to anADC system is expensive and can require physically reconfiguring the ADCsystem (e.g., fabricating a revised printed circuit board (PCB) on whichthe analog input signals are routed). The “costs” discussed above (ofsampling at too high or too low a rate and post-processing) must beweighed against the undesirability of appropriating more than one analoginput pin for one (composite) analog input signal and the associatedmemory and processing costs.

The ADC system of FIG. 2 is also relatively inflexible in regard tochanges to an analog input signal's requirements. For example, therequired sample rate can change as a result of a manufacturer's designchange, or as a consequence of field test results. For example, an automanufacturer can decide, for any of a variety of reasons, that in futuredesigns of an engine, a given signal should be sampled at a differentrate than in prior engines. Or, for example, an engine service centercan detect that a sample rate specified by engine control systemdesigners is insufficient for detection of certain engine conditions(e.g., specified sample rate for a knock signal is too low to detectengine knocking).

If the required sample rate for a given analog input pin changes, theADC system of FIG. 2 must either change the sample rate for the commandqueue that lists that analog input pin or include the analog input pinin a different command queue. The ADC system can change a commandqueue's sample rate, for example, by specifying a different trigger thatoccurs more frequently or less frequently than the previously specifiedtrigger. However, changing the sample rate for a command queue affectsall analog input pins listed in the command queue, which may haveunwanted effects, such as sampling analog input values too often in thecase of some analog input pins or too infrequently in the case of otheranalog input pins. Rerouting an analog input signal to a differentanalog input pin requires physical reconfiguration (e.g., severingtraces and adding wires on a PCB). Furthermore, including the analoginput pin in a different command queue may be difficult or impossible.In order to include the analog input pin in a different command queue,an engine control system designer must determine if any command queuesare available to accept additional analog input pins, and select acommand queue, if one is available, that specifies a sample rate thatmeets the required sample rate for the analog input pin being moved. Ifa suitable queue is available, the designer must add the analog inputpin to the command queue's list of analog input pins and remove theanalog input pin from the list in the command queue which previouslylisted the analog input pin. All of these operations add cost to and/orreduce the efficiency of the ADC system.

Another limitation of the ADC system of FIG. 2 concerns prioritymanagement for the ADC system's analog input pins. The ADC system ofFIG. 2 has multiple command queues and multiple ADCs. Each command queuehas an associated priority. The priority of each command queue affectsthe order in which sampled analog input values from analog input pinslisted in each command queue are converted to digital values by the ADCsystem's ADCs. When a command queue's trigger occurs, the command queuesends a conversion request to ADC control logic. The conversion requestcan take the form of the command queue sending a message to ADC controllogic. In one embodiment, the command queue can set a flag that isperiodically polled by the ADC logic. Setting the flag indicates thecommand queue has a pending conversion request. The conversion requestspecifies that an analog input value should be sampled from an analoginput pin listed in the command queue. When the ADC control logicdetects a conversion request (e.g., by detecting that a command queuehas set its conversion request pending flag), the ADC control logic canidentify (e.g., by reading the command queue's pointer) the analog inputpin from which an analog input value is to be sampled.

The ADC control logic can also evaluate the command queue's priority. Inthe event that multiple command queues have conversion requests that arepending concurrently, the ADC control logic can select one of theconversion requests by selecting the command queue with the highestpriority of those command queues with pending requests. Next, ADCcontrol logic can initiate a sampling of an analog input value from anidentified analog input pin listed in that command queue and an ADC canconvert the analog input value to a digital value.

If an ADC system has multiple ADCs, ADC control logic can processmultiple conversion requests simultaneously. For example, if the ADCsystem has two ADCs and at a given time four conversion requests arepending, the ADC control logic can process the two conversion requestsfrom the two command queues having the highest priority of those commandqueues having pending conversion requests. This causes two analog inputvalues to be sampled from two analog input pins (one analog input pinfrom each command queue) and converted simultaneously.

In the ADC system of FIG. 2, the priority of each analog input pinlisted in a command queue's list of analog input pins is the same, i.e.,the priority assigned to the command queue is assigned to each analoginput pin listed in the command queue, in order to simplify the ADCcontrol logic. This means the control logic can keep track of thepriority of each command queue, and need not keep track of a priorityfor each analog input pin. Since an ADC system generally includessignificantly fewer command queues than analog input pins, it is simplerto keep track of priority on the basis of command queues rather thananalog input pins.

However, such a system is inflexible and can lead to inefficientutilization of ADC resources. For example, consider an analog input pinthat is low priority during one period of time, and high priority duringa second period of time. Such an example could arise in the case of ananalog input pin coupled to a knock sensor. For the majority of anengine cycle, knock is unlikely, and the analog input pin on which theknock sensor values are available can be assigned a low priority.However during the relatively short period of the engine cycle when theengine is nearing combustion, the knock sensor values are a higherpriority, and must be sampled and converted relatively quickly. In thisexample, if the knock sensor values are available on an analog input pinthat is listed in a lower priority command queue, the knock sensorvalues may not be sampled and converted in a timely manner, andimportant knock sensor values may not be captured. On the other hand, ifthe analog input pin that receives the knock sensor value is placed in ahigher priority queue, the knock sensor values may be prioritized(sampled and converted) ahead of other analog input pins during theperiods of time when the knock sensor value is of little interest.During these periods it is desirable to prioritize the analog input pinon which knock sensor values are available below other analog inputpins.

However, the ADC system of FIG. 2 does not provide such flexibility.Instead, in the ADC system of FIG. 2, one must either include the analoginput pin on which the knock signal is available in a low prioritycommand queue and risk losing important knock sensor values, include theanalog input pin on which the knock signal is available in a highpriority queue and risk sampling the knock sensor values ahead of otheranalog input values during a time when the knock sensor values arerelatively unimportant, or include the analog input pin on which theknock signal is available in multiple queues. The disadvantages ofincluding an analog input pin in multiple queues have already beendiscussed.

Yet another problem with the ADC system of FIG. 2 arises in connectionwith latency. Latency refers to the delay between the time thatconversion of an analog input value is requested (e.g., in response tothe occurrence of a trigger) and the time that the analog input value issampled and converted.

The latency of an ADC system is an important characteristic of the ADCsystem. Generally latency is considered undesirable in an ADC system.Latency can limit the performance of a control system, e.g., an enginecontrol system that encompasses the ADC system. Increased latency cancause jitter and lead to errors in the control system. Designersgenerally expend significant efforts to minimize latency. There areseveral ways to do so. One way to reduce latency, for example, is to usefaster ADCs. Faster ADCs can convert more values in less time. However,faster ADCs are generally more expensive and bigger. Another way todecrease latency is to add one or more additional ADCs to the ADCsystem. This also is more expensive and requires more space. The spaceavailable for control system components is generally limited. Forexample, in an automobile engine control system, engine control systemcomponents are often crowded into small spaces in an engine compartmentor behind the dashboard of a car. Accordingly, it is desirable tominimize the space required for control system components.

Many ADC systems, such as ADC system 150 of FIG. 2, include multipleADCs to convert analog input values from the system's analog input pinsto digital values. Each ADC converts values from a subset of the ADCsystem's analog input pins. For example, if an ADC system includes 100analog input pins and two ADCs, a first ADC may be assigned the first 50analog input pins of the 100 analog input pins and a second ADC may beassigned the second 50 analog input pins of the 100 analog input pins.In this example, when an analog value sampled from an analog input pinin the first 50 analog input pins needs to be converted to a digitalvalue, the first ADC performs the conversion. Similarly, when an analogvalue sampled from an analog input pin in the second 50 analog inputpins needs to be converted to a digital value, the second ADC performsthe conversion.

Assigning analog input signals to particular ADCs is generally moreinvolved than an arbitrary division such as that described above. Whenassigning analog input signals to ADCs, designers carefully considerfactors such as the frequency with which each analog input signal willneed to be converted and the priority of each analog input pin. In orderto optimize ADC system performance and minimize the effects of latency,it is desirable to have the total number of conversions performed by theADC system roughly evenly divided among each of the system's ADCs.Otherwise, if one of the ADCs is busier than the others, e.g., one ADCis performing significantly more conversions than the other ADCs, thebusy ADC may introduce increased latency as a result of being unable toconvert analog values as quickly as needed.

In the case where the other ADCs in the system are less busy (have fewerconversions to perform) sharing the load between the ADCs can be aneffective way to reduce latency. In order to balance the conversion loadbetween an ADC system's ADCs, designers can spend significant effort andcare when designing the system to attempt to insure that each ADCprocesses approximately the same number of conversions. That is, if thesystem requires 50 conversions per second, the system designers canattempt to insure that approximately 25 go to each ADC (assuming that inthis example the ADC system includes two ADCs).

Designers can attempt to predict which analog input signals are likelyto be more active (require more conversions) and assign those analoginput signals among the system's ADCs in such a manner that each ADC hassome of the more active signals and some of the less active signals. Allof an ADC system's analog input pins can be divided and assigned amongthe ADC system's ADCs in this way to attempt to ensure a balancedconversion load between the ADCs. This design process can be difficultfor a number of reasons.

One factor that contributes to the difficulty of balancing a conversionload across all of an ADC system's ADCs is that the bandwidthrequirements (number of conversions needed) for a given analog inputsignal can change over time. For example, in a first period of time, oneof the analog input signals assigned to an ADC might be active,requiring frequent sampling and conversion and so demanding most of theADCs resources. During this time period, other analog input signals,which may have lower priority, assigned to the ADC may experienceincreased latency. That is, the wait time between when a sample andconversion operation is requested for one of these lower priority analoginput signals and when an analog input value is actually sampled andconverted to a digital value may increase. As noted, increasing thiswait time for analog input signals can have negative effects on the restof the system (e.g., errors due to jitter).

During a second period of time, an analog input signal that was activeduring the first time period might be much less active. As a result, anylatency problems other (e.g., lower priority) analog input signalsexperienced during the first time period (e.g., as a result of an ADC'sresources being “hogged” by an active higher priority analog inputsignal) may not be an issue during the second time period. It can bedifficult to accurately predict how much bandwidth will be needed byeach analog input signal under all circumstances. Accordingly, loadbalancing between an ADC system's ADCs by assigning analog input signalsto each ADC can be a difficult task. Ultimately, designers may be unableto assign analog input signals to ADCs such that problems due to latencyare completely avoided.

Another problem with developing a scheme for assigning an ADC system'sanalog input signals to the ADC system's ADCs is that if designers wishto increase ADC bandwidth by adding additional ADCs, the entire loadbalancing design process must be undertaken again to attempt to predictwhich analog input signals will be most active and balance the loadacross the new number of ADCs accordingly. Thus, having an ADC system'sanalog input signals assigned to particular ones of the ADC system'sADCs introduces inflexibility into the system in that modifying orexpanding the system requires significant redesign of the analog inputsignal assignment scheme.

Another concern related to latency can arise as a result of having asingle sample and hold module shared by multiple analog input pins. Asillustrated, ADC system 150 of FIG. 2 includes two multiplexers 220, twosample modules 240, and two ADCs 250. ADC system 150 includes one samplemodule for each ADC. As noted above, a particular group of analog inputpins is assigned to each of the ADCs 250. In some cases, samples mayneed to be read from multiple analog input pins concurrently. That is, atrigger can occur that initiates sampling of a first analog input valuefrom a first analog input pin. Before the ADC system has had a chance tocomplete sampling and conversion of the first analog input value, asecond trigger can occur that initiates sampling of a second analoginput value from a second analog input pin. In this case, an analoginput value needs to be sampled from each of two analog input pins. Ifthe two analog input pins are both assigned to a single ADC 250, ADCcontrol logic 230 must delay one of the sample operations since ADCsystem 150 includes only one sample module for each ADC.

Delaying one of the sample operations incurs latency, and can introducejitter and errors into the ADC system. In one case, by the time ananalog input value is sampled from the second analog input pin (afterthe delay caused by sampling the first analog input value from the firstanalog input pin and converting the first analog input value to adigital value), the analog input value on the second analog input pinhas changed since the time when the second trigger occurred. This mayresult in suboptimal performance of engine control system 110 (whichincludes ADC system 150). That is, the second analog input value sampledmay not accurately reflect the engine's operating conditions at the timethat the second trigger occurred, and so the engine control system maynot effectively control the engine. Unfortunately, in an ADC system,with only one sample module for each ADC, such a possibility isunavoidable

FIG. 5 is a block diagram that illustrates relevant components of anexample ADC system 500, according to one embodiment. As shown, ADCsystem 500 includes multiplexers 515. The inputs 1 through N ofmultiplexers 515 can be coupled to analog input pins that are in turncoupled to analog input sources. For example, an analog input pin can becoupled to a sensor that measures engine performance characteristics,such as an oxygen sensor (not shown). Thus, analog input values (e.g., asensor's output values) are present on the inputs of multiplexers 515.

The outputs of multiplexers 515 are shown coupled to sample modules 520,which are shown coupled to ADCs 525. ADC system 500 is shown with twomultiplexers, sample modules, and ADCs. In other embodiments, ADC system500 can include more or less than two multiplexers, sample modules, andADCs. When ADC control logic 510, selects one of multiplexer 515'sinputs, an analog input value present on that input is transmitted to asample module 520 and then to an ADC 525. The ADC 525 converts theanalog input value to a digital value that can be used by the enginecontrol system to control an engine's operating characteristics. Foreach multiplexer 515, ADC control logic 510 can select which multiplexerinput to select based on which analog input pin is listed next in anactive queue 512 that corresponds to that multiplexer 515. That is, ADCcontrol logic 510 can detect which analog input pin is listed in one ofactive queues 512, and then provide a control signal to the multiplexer515 that corresponds to that active queue 512 such that an analog inputvalue is passed from the listed analog input pin to sample module 520.ADC control logic 510 includes an active queue 512 for each of the ADCsystem's ADCs 525. ADC control logic is also coupled to peripherals 540,which can include, for example, direct memory access, timedinput/output, and/or serial communications interfaces.

In the illustrated embodiment, ADC control logic 510 is coupled tomultiple signal objects 535(1)-535(N). A signal object can include agroup of configuration, status, and result registers and buffers storedin memory that specifies the characteristics of an analog to digital(A/D) conversion operation, and stores the results data. ADC controllogic 510 can use information in signal objects 535 to determine whichanalog input value to convert (which input of multiplexer 515 to select)and at what time to do so.

FIG. 6A is a more detailed view of relevant components of an examplesignal object, such as signal object 535 of FIG. 5, including variouspieces of information that can be stored in the signal object'sregisters or alternatively in RAM memory. Signal object 535, as shown,includes an analog input pin register 605, a sample trigger register610, a window open register 615, a window close register 620, a priorityregister 625, a status flag(s) register 635, a time stamp register 640,a conversion result buffer 645, and an other configurations register650.

FIG. 6B is a detailed illustration of relevant components of an examplestatus flags register, such as status flags register 635 of FIG. 6A.FIG. 6B shows an enabled/disabled flag 660, a conversion request pendingflag 665, a conversion in progress flag 670, and a new data exists flag675. These flags are used by an ADC system, such as ADC system 500, tosample and convert analog input values.

There can be one or more signal objects associated with each analoginput signal in an engine control system. A signal object associatedwith a particular analog input signal can provide conversion parametersfor that signal. For example, if an engine's knock sensor is coupled toan analog input pin that is coupled to pin 1 of an ADC system'smultiplexer, a signal object associated with the knock signal canidentify pin 1 as the analog input pin on which the knock signal isavailable. Signal object 535 of FIG. 6 can store information in analoginput pin register 605 that can be used to identify the analog inputpin.

In order to know when to sample an analog input value, ADC control logiccan access a signal object's trigger register, such as trigger register610 of FIG. 6A. The trigger register can specify that the occurrence ofa particular condition should serve as the trigger for the ADC controllogic to initiate a sample of the analog input pin specified by thesignal object. For example, a signal object's trigger register canspecify a certain value of a timer (e.g., internal sample timer 505 ofFIG. 5) as the trigger. When the timer reaches the given value, ADCcontrol logic can initiate sampling an analog input value from theanalog input pin specified by the signal object. The trigger can also bethe occurrence of some event, such as an external timer (e.g., systemtimer 550 of FIG. 5) reaching a certain value, or some event associatedwith a system peripheral (e.g., one of system peripherals 560 of FIG.5).

The signal object illustrated in FIG. 6A also includes a window openregister 615 and a window closed register 620. When a signal object'swindow has opened (and not yet closed) analog input values can besampled in response to the signal object's trigger. The sampling window(the period between the occurrence of a window open event and theoccurrence of a window closed event) defines a period in which samplingand conversion of the analog values present on an analog input pin areallowed to occur. Outside of a signal object's defined sampling window(e.g., before the window opens or after the window closes), the signalobject will not initiate sampling and conversion, even when the signalobject's trigger occurs. The sample window opens and closes based onconditions identified in the window open and close registers of thesample object. Similar to a trigger, the window opening and closing canbe based on, for example, a timer (either internal or external) in thetime, angle, or analog domain, or an external peripheral. For example, asample window can be based on angle domain events (e.g., a sample windowopens when engine angle is 0 degrees and closes 360 degrees of enginerotation later). When a sample window opens, the signal object canindicate that the signal object is enabled, e.g., by setting a signalobject enabled flag, such as the enabled/disabled flag 660 of FIG. 6B.When a sample window closes, the signal object can clear the signalobject enabled flag. The signal object enabled flag can be set andcleared for other reasons as well. For example, a signal object can bedisabled during debug or testing of the engine control system.

When a signal object's trigger occurs while sample window is open, thesignal object is said to request conversion. That is, ADC control logicdetects that an analog input value should be sampled from the analoginput pin specified by the signal object and transmitted to an ADC to beconverted to a digital value. A signal object can request conversion,for example, by setting a conversion request pending flag, such asconversion request pending flag 665 of FIG. 6B. The ADC control logiccan detect if a signal object's conversion request pending flag is set.For example, ADC control logic can poll a status flags register, such asstatus flags register 635 of FIG. 6A. If ADC control logic detects asignal object's conversion request pending flag is set, the ADCdetermines that the signal object is requesting conversion.

Ideally, as soon as a signal object's trigger occurs and the signalobject sets its conversion request pending flag, ADC control logic willdetect the conversion request pending flag and will initiate sampling ofan analog input value from the signal object's analog input pin. Then,ideally with no delay, the sampled analog input value is converted by anADC. However, as discussed above, a signal object can request conversionat a time when all of an ADC system's ADCs are busy converting otheranalog input values. Also, in an ADC system with multiple signalobjects, several signal objects can request conversion simultaneously.If there are more signal objects requesting conversion than theavailable number of ADCs in the ADC system, the ADC system needs someway of determining which signal object should be processed first.

An ADC is available if the ADC is not busy converting an analog inputvalue to a digital value, including receiving the analog input value andstoring the digital value. For example, if an ADC system has three ADCs,but one is busy converting an analog input value, the ADC system has twoADCs available. In this example, if three signal objects requestconversion simultaneously, there are only enough ADCs available toconvert analog input values from two of the three analog input pins andso the ADC control logic must determine which two of the three toprocess first.

Each signal object has an assigned priority stored in a priorityregister, such as priority 625 of FIG. 6A. ADC control logic can accessa signal object's priority to help determine the order in which signalobjects with conversion request pending flags set are processed. The ADCcontrol logic maintains an active queue, such as active queue 512 ofFIG. 5. When ADC control logic selects a signal object for processing,the ADC control logic can create a conversion request corresponding tothat signal object and add the conversion request to the active queue.When a conversion request is processed by an ADC, ADC control logic canremove the conversion request from the active queue.

When ADC control logic detects that a signal object has a conversionrequest pending flag set, the ADC control logic can create a newconversion request and add the new conversion request to the activequeue. The new pending conversion request can be added to the activequeue's list such that pending conversion requests having higherpriority than the new pending conversion request are processed beforethe new pending conversion request and pending conversion requestshaving lower priority than the new pending conversion requests will beprocessed after the new pending conversion request. For example, if thenew pending conversion request has a higher priority than any otherpending conversion request in the active queue's list, the new pendingconversion request will be inserted at the top of the active queue'slist and will be processed ahead of any other pending conversionrequests in the active queue's list. Other pending conversion requestswill be delayed until the highest priority pending conversion request isprocessed. After the highest priority conversion request is processed,the conversion request from the signal object having the next highestpriority is processed, and so on, until all the pending conversionrequests have been processed in order of highest priority to lowestpriority.

In one embodiment, ADC control logic includes a starvation preventionmechanism to insure that lower priority conversion requests areprocessed. For example, ADC control logic can include a timer that keepstrack of the amount of time conversion requests have been stored in anactive queue. If the time a lower priority conversion request has beenstored in an active queue exceeds a certain value, the lower priorityconversion request can be processed ahead of higher priority conversionrequests.

After an ADC samples an analog input value from an analog input pin andconverts the analog input value to a digital value, the ADC can transmitthe digital value to the ADC control logic. The ADC control logic canstore the digital value in a signal object's result buffer, such asconversion result buffer 645 of FIG. 6A. ADC control logic stores thedigital value in the result buffer of a signal object whose triggerinitiated the sampling of the analog input value that was converted intothe digital value. Each signal object includes or identifies a resultbuffer that stores the conversion results for the analog input signalthe signal object specifies. This buffer is accessible to a consumer ofthe digital values, such as direct memory access (DMA), processingunits, peripherals, and the like.

When conversion results are stored in a signal object's result buffer,the signal object can notify a consumer of the availability of theconversion results. The signal object can set a flag, such as the newdata exists flag 675 of FIG. 6B, in the signal object's status flagsregister. Consumers of the conversion results can read the value in thestatus flags register. If the new data exists flag is set, the consumercan read the conversion results from the conversion result buffer.Consumers of the conversion results can periodically poll the new dataexists flag. Alternatively, the signal object can send a notificationsignal to a consumer via ADC control logic identifying the signalobject, indicating that the signal object's conversion result buffer hasdigital values stored therein, and providing an address in memory wherethe conversion result buffer is located.

In addition to the status flags discussed above, additional signalstatus flags can exist. For example, a signal object can include aconversion in progress flag, such as conversion in progress flag 670 ofFIG. 6B. A signal object can set a conversion in progress flag after ADCcontrol logic adds a signal object's conversion request to the ADCcontrol logic's active queue. Alternatively, the signal object can setthe conversion in progress once notified by ADC control logic that ananalog input value has actually been sampled from the signal object'sanalog input and is being converted by an ADC. These flags can be readby consumers of a signal object's digital values to monitor theoperation of a signal object in order to determine when or whetherconversion results (digital values) are available.

At completion of a conversion operation, e.g., when ADC control logictransmits conversion results to a signal object's result buffer, asignal object can capture and store a contemporaneous time stamp. Forexample, a time domain timer can be used that is set to zero at somepredefined moment (e.g., the start of an engine) and advances 1 tick forevery 10 milliseconds. A signal object can store whatever value thistimer reads (e.g., 150 ticks) upon completion of a conversion operationin the signal object's conversion complete time stamp register, such astime stamp register 640 of FIG. 6A, to indicate that the most recentconversion completed at 150 ticks (or 1.5 seconds). The signal objectshould be configurable to allow a variety of time stamp sources to beused. For example, an angle domain timer that advances 1 tick for every6 degrees of engine rotation can be used. In this example, if aconversion operation completes at 150 ticks of the angle domain timer,the value 150 can be stored in the signal object's conversion completetime stamp register to indicate that the most recent conversioncompleted after 150 ticks (or 900 degrees of engine rotation).

As illustrated in FIG. 6A, signal object 535 can include otherconfigurations. For example, a signal object can include a softwaretrigger. A software trigger can involve receiving a message from one ormore of various programs running in the engine control system. Inanother embodiment, a software trigger involves evaluating an algorithmincluded in a signal object. If the evaluation produces a specifiedresult, the signal object can initiate a conversion operation, e.g., bysetting a conversion request pending flag.

A signal object can also include conversion performance criteria thatspecify, for example, how often the signal object should initiate aconversion operation. If the signal object's trigger fails to occur asfrequently as specified by the conversion performance criteria, thesignal object can be configured to initiate a conversion operationwithout the signal object's trigger occurring. In another embodiment,the performance criteria can specify that the signal object shouldinitiate sampling outside the signal object's sample window. In thisway, the performance criteria can override or alter the conversionperformance specified by the other elements of the signal object andinsure, for example, a minimum sample rate.

A signal object's sample rate can be set, e.g., by a designer, to anyvalue. Thus, each signal processed by an ADC system such as the ADCsystem of FIG. 5 can have a sample rate that is set to exactly the ratedesired. Furthermore, if a signal's sample rate needs to be changed, adesigner can simply reconfigure the signal object to specify a differentsample rate. For example, a designer can change a signal object'strigger to a trigger that occurs more or less frequently. This changecan be performed via a software programming change. Similarly, ifadditional analog input signals need to be sampled, designers can simplyadd an additional signal object. Thus, changing conversion parametersfor an analog input signal is a simple software change, and does notrequire extensive rerouting or reconfiguration which can potentiallyaffect other areas of the ADC system. In one embodiment, an ADC controlsystem can change a signal object's sample rate on the fly, for example,in response to detecting changing engine conditions.

Each signal object applies to one analog input signal. Multiple signalobjects can be applied to a single analog input pin. This is useful, forexample, to decompose composite signals. When multiple signals (e.g., acoil current signal, a knock signal, and a misfire signal) are availableon a single analog input pin, the ADC system can include a signal objectfor each of the analog input signals available on the analog input pin.Thus, multiple signal objects can exist that each specify the sameanalog input pin. But if the multiple signal objects specify differenttriggers, different analog input signals can be captured from the sameanalog input pin. As can be seen, there is not a one-to-one correlationbetween signal objects and analog input pins. In order to fully utilizeall analog input pins, there must be at least as many signal objects asanalog input pins. However, multiple signal objects can be used for asingle analog input pin.

In one embodiment, a single analog input signal can be assigned multipledifferent priorities. In order to do so, multiple signal objects can beassociated with the analog input signal. Each of the signal objects canhave a different priority as well as different sample windows. Thus, ata first time, an analog input signal can have a first priority whilehaving a different priority at a second time.

FIG. 7 is a flow diagram showing relevant aspects of the operation of anADC system that includes signal objects, according to one embodiment.The process illustrated by FIG. 7 begins at start operation 700. Atdecision operation 720, ADC control logic, such as ADC control logic 510of FIG. 5, detects whether any of the ADC system's signal objects, suchas signal objects 535 of ADC system 500 of FIG. 5, require processing.That is, ADC control logic detects whether a trigger has occurred suchthat an analog input value should be sampled from an analog input pinassociated with any of the ADC system's signal objects. In order todetect the need to sample an analog input value, ADC control logic can,for example, read the status flags, such as status flags 635 of FIG. 6A,of some or all of the ADC system's signal objects. If a signal objecthas set a conversion request pending flag, such as conversion requestpending flag 665 of FIG. 6B, the signal object is requesting conversion.Alternatively, a signal object can send a conversion request signal toADC control logic. For example, a signal object can send a signal, suchas an interrupt signal, to ADC control logic indicating that the signalobject has a conversion request pending.

Once ADC control logic detects that a signal object is requestingconversion, ADC control logic can also detect whether the signal objectis enabled. For example, ADC control logic can read the signal object'senabled/disabled flag, such as enabled/disabled flag 660 of FIG. 6B. Theenabled flag can be set by the signal object upon the signal object'ssample window opening and cleared by the signal object upon the signalobject's sample window closing. If a signal object's conversion requestpending flag and enabled flag are both set, the signal object needsprocessing. If no signal object requires processing ADC control logicwaits, e.g., loops, until a conversion is requested.

Once ADC control logic detects a conversion request, i.e., once a signalobject indicates to ADC control logic that an analog input value shouldbe sampled from the analog input pin specified by the signal object andconverted to a digital value, from an enabled signal object, ADC controllogic evaluates the priority of the signal object that submitted theconversion request, at an evaluate priority operation 730. ADC controllogic can evaluate a signal object's priority by, for example, accessingthe signal object's priority register, such as priority register 625 ofFIG. 6A. Alternatively, a signal object can transmit a priorityindication to ADC control logic along with a conversion request. Basedon the priority of the signal object that submitted the conversionrequest, ADC determines where in an active queue, such as active queue512 of FIG. 5, to insert the conversion request.

In operation 740, ADC control logic inserts the conversion request intothe active queue in the appropriate place. Once the conversion requestis listed in the active queue, ADC control logic can update the signalobject's flags, for example, by clearing the signal object's conversionrequest pending flag and setting the signal object's conversion requestin progress flag. After ADC control logic inserts the conversion requestinto the active queue, the process returns to decision operation 720 todetermine whether any additional conversion requests have beensubmitted.

FIG. 8 is a flow diagram showing further relevant aspects of theoperation of an ADC system, according to one embodiment. The processillustrated by FIG. 8 begins at start operation 800. Next, the processproceeds to decision operation 810 during which ADC control logicdetects whether there are any pending conversion requests in any of theADC system's active queue. That is, has a conversion request beensubmitted by a signal object and added by ADC control logic to an activequeue. If not, the process illustrated by FIG. 8 loops until aconversion request is pending, e.g., added to an active queue.

When a conversion request is pending, ADC control logic then detects, indecision operation 820, whether an ADC, such as an ADC 525 of FIG. 5, isavailable to convert an analog input value to a digital value. If, forexample, all of the ADC system's ADCs are busy converting other analoginput values, the process illustrated by FIG. 8 loops until an ADCbecomes available. Once an ADC becomes available, the processillustrated by FIG. 8 proceeds to identify analog input pin operation830. The identify analog input pin operation involves ADC control logicdetecting which analog input pin corresponds to the first pendingconversion request in the active queue. In order to do so, ADC controllogic can access the signal object that initiated creation of theconversion request and detect which pin the signal object identifies.Alternatively, the conversion request stored in the active queue caninclude information identifying the analog input pin identified by thesignal object associated with the conversion request.

Next, the process illustrated by FIG. 8 proceeds to sample analog inputvalue operation 840. In the sample analog input value operation, ADCcontrol logic can detect which input pin of a multiplexer, such asmultiplexer 515 of FIG. 5, corresponds to the identified analog inputpin. ADC control logic can send a control signal to the multiplexer totransmit an analog input value from that input pin of the multiplexer toa sample module, such as sample module 520 of FIG. 5, that correspondsto the ADC that is to convert the analog input value.

In convert value operation 850, an ADC reads the analog input valuestored in the corresponding sample module and converts the analog inputvalue into a digital value. Next, in store result operation 860, the ADCstores the digital value in the signal object's result buffer, such asconversion result buffer 645 of FIG. 6A. ADC control logic can detectthat the digital value is stored and update the signal object's flagsaccordingly, for example by setting a new data exists flag, such as newdata exists flag 675 of FIG. 6B, and clearing a conversion in progressflag, such as conversion in progress flag 670 of FIG. 6B. The processillustrated by FIG. 8 ends at end operation 899.

FIG. 9 is a flow diagram that illustrates further relevant aspects ofthe operation of an ADC system, according to one embodiment. FIG. 9 isdescribed with reference to an example composite signal, such as thecomposite signal shown in FIG. 4. The process illustrated by FIG. 9begins at start operation 900. At first window opens operation 910, ADCcontrol logic detects that a signal object's sample window opens. Thesample window can open, for example, as a result of a timer reaching aspecified value. In another embodiment, ADC control logic receives asignal specified in the signal object that signifies that the signalobject's sample window is open. The signal object's enable flag can beset in response to the sample window opening. If the signal object'strigger occurs while the signal object's window is open, ADC controllogic will sample the signal object's analog input pin. In this example,the occurrence of the window event can coincide with point A in FIG. 4.

Subsequent to the first sample window opening, ADC control logic detectsthe occurrence of the signal object's trigger and initiates samplinganalog input values from the analog input pin associated with the signalobject at a first sample rate at operation 920. The first sample rate isbased on the frequency of occurrence of the signal object's trigger. Thesampled analog input values are converted to digital values by an ADCand stored in the signal object's result buffer. In the example of FIG.4, these digital values are coil current signal results, or coil currentdata. Subsequent to the first sample window opening, ADC control logicdetects that the first sample window closes at first sample windowcloses operation 930. In the example of FIG. 4, this corresponds to thecoil current window closing at point B.

Next, FIG. 9 illustrates second sample window opens operation 940. TheADC control logic detects that a sample window associated with a secondsignal object opens. In the example of FIG. 4, this corresponds to amisfire window opening at point C. Operation 950 illustrates sampling ata second sample rate. The second sample rate is based on the frequencyof occurrence of the second signal object's trigger. The analog inputvalues sampled from the analog input pin during the second sample windowin response to the occurrence of the second signal object's trigger areconverted to digital values by an ADC and stored in the second signalobject's result buffer. In the example of FIG. 4, these digital valuesare misfire signal results, or misfire data.

At some time after the second sample window opens, while the analoginput pin is being sampled at a second rate, ADC control logic detectsthe opening of a third sample window associated with a third signalobject at third sample window opens operation 960. The third samplewindow opening corresponds to point D in the example of FIG. 4, wherethe knock window opens. Operation 970 illustrates sampling at a thirdsample rate. The third sample rate is based on the frequency ofoccurrence of a trigger associated with the third signal object. Thesampled analog input values are converted to digital values by an ADCand stored in the third signal object's result buffer. In the example ofFIG. 4, these digital values are knock signal results, or knock data. Atoperation 980, ADC control logic detects the third sample windowclosing. The third sample window closing corresponds to point E in theexample of FIG. 4, or the closing of the knock window.

The process illustrated by FIG. 9 then proceeds to second sample windowcloses operation 990. The ADC detects the second sample window closingat a point that corresponds to point F in the example of FIG. 4, or theclosing of the misfire window.

While the knock and misfire window are open concurrently, both themisfire signal object and the knock signal object cause sampling of theanalog input pin on which the composite signal of FIG. 4 is available.In this way, the signal object is sampled at a rate that is appropriateto detect misfire and another rate appropriate to detect knock. Thedigital values that represent misfire data are stored in the misfiresignal object's result buffer and the digital values that representknock data are stored in the knock signal object's result buffer. Anengine control system can access these results without needing to parsethe results. The engine control system can access these results via DMAor a processor. Separating the multiple source signals thus decomposesthe composite signal of FIG. 4. The process illustrated by FIG. 9 endsat end operation 999.

While FIG. 9 (and FIG. 4) are shown in the context of a composite objecthaving 3 separate source signals, the present invention is not limitedto any particular number of source signals in a single composite signal.To the contrary, any number of source signals can be included in asingle composite signal. Similarly, any number of signal objects havingany number of sample windows can be employed to affect the sampling ofanalog input values from a given analog input signal.

FIG. 10 is a block diagram that illustrates relevant components of anexample ADC system 1000, according to one embodiment. As shown, ADCsystem 1000 of FIG. 10 includes multiplexer 1015. The inputs 1 through Nof multiplexer 1015 can be coupled to analog input pins that are in turncoupled to analog input sources (not shown). For example, an analoginput pin can be coupled to a sensor that measures engine performancecharacteristics, such as an oxygen sensor. Thus, analog input values(e.g., a sensor's output values) are present on the inputs ofmultiplexer 1015.

Multiplexer 1015 is a multiple input/multiple output multiplexer. Thatis, multiplexer 1015 can pass analog input values from multiple inputpins to multiple output pins. Multiplexer 1015 is shown as having Npossible inputs and M possible outputs. N corresponds to the number ofanalog input pins, and M corresponds to the number of sample modules andADCs included in ADC system 1000. Generally, N is greater than M. Theoutputs of multiplexer 1015 are shown coupled to sample modules1020(1)-1020(M), which are shown coupled to ADCs 1025(1)-1025(M). Asshown, ADC system 1000 includes ADC control logic 1010. When ADC controllogic 1010, selects one of multiplexer 1015's inputs, an analog inputvalue present on the selected input is transmitted to one of samplemodules 1020(1)-1020(M) and then to one of ADCs 1025(1)-1025(M). The ADC1025 converts the analog input value to a digital value that can be usedby an engine control system, such as engine control system 100 of FIG.1, to control an engine's operating characteristics. ADC control logic1010 selects which multiplexer inputs to select based on which analoginput pins are listed in active queues 1012(1)-(M), which are shownincluded in ADC control logic 1010. ADC control logic 1010 can includean active queue 1012 for each of the ADC system's ADCs 1025.

In the illustrated embodiment, ADC control logic 1010 is coupled tomultiple signal objects 1035(1)-1035(P). ADC control logic 1010 is alsoshown coupled to internal sample timer 1005, external timer 1050,external peripherals 1060, and peripherals 1040.

FIG. 10 has all inputs multiplexed across all ADCs. Thus when a signalobject submits a conversion request, ADC control logic must determinewhich ADC to assign the conversion request. This is done each time asignal object requests conversion since the signal object's analog inputpins are not fixedly assigned at some initial time to a specific ADC.This is done dynamically based on the utilization of the ADC system'sADCs.

For example, ADC control logic can monitor the number of pendingconversion requests for each ADC of ADC system 1000 by monitoring activequeue 1012. Doing can help reduce latency in the ADC system. Conversionrequests are allocated from the head of active queue 1012 to all samplemodules and ADCs in the ADC system. ADC control logic can evaluatecertain factors in determining which of the ADC system's ADCs shouldconvert a given analog input value. For example, ADC control logic candetect whether some of the ADCs convert analog input values to digitalvalues faster than others, e.g., as a result of being newer or moreadvanced technology.

FIG. 11 is a flow diagram that illustrates relevant aspects of theoperation of an ADC system, according to one embodiment. FIG. 11 beginsat a start operation 1100. At decision operation 1110, ADC controllogic, such as ADC control logic 1010 of FIG. 10, detects whether anysignal objects, such as one of signal objects 1035 of FIG. 10, requireprocessing. That is, ADC control logic detects whether a trigger hasoccurred such that an analog input value should be sampled from ananalog input pin associated with any of the ADC system's signal objects.In order to detect the need to sample an analog input value, ADC controllogic can, for example, read the status flags, such as status flags 635of FIG. 6A, of some or all of the ADC system's signal objects. If asignal object has set a conversion request pending flag, such asconversion request pending flag 665 of FIG. 6B, the signal object isrequesting conversion. Alternatively, a signal object can send aconversion request signal to ADC control logic. For example, a signalobject can send a signal, such as an interrupt signal, to ADC controllogic indicating that the signal object has a conversion requestpending.

Once ADC control logic detects that a signal object is requestingconversion, ADC control logic can also detect whether the signal objectis enabled. For example, ADC control logic can read the signal object'senabled/disabled flag, such as enabled/disabled flag 660 of FIG. 6B. Theenabled flag can be set by the signal object upon the signal object'ssample window opening and cleared by the signal object upon the signalobject's sample window closing. If a signal object's conversion requestpending flag and enabled flag are both set, the signal object needsprocessing. If no signal object requires processing ADC control logicwaits, e.g., loops, until a conversion is requested.

Once ADC control logic detects a conversion request, i.e., once a signalobject indicates to ADC control logic that an analog input value shouldbe sampled from the analog input pin specified by the signal object andconverted to a digital value, from an enabled signal object, ADC controllogic must determine which ADC of the ADC system's ADCs should convertan analog input value corresponding to the conversion request. In orderto determine which ADC should convert the analog input value, ADCcontrol logic can evaluate utilization of the ADC system's ADCs at anevaluate utilization of ADCs operation 1120. In order to do so, ADCcontrol logic can track the number of conversion operations performedand pending for each ADC in the ADC system. Based on the evaluation ofADC utilization statistics, ADC control logic can select one of the ADCsystem's ADCs to convert the analog input value that corresponds to theconversion request at a Select ADC based on utilization operation 1130.

At operation 1140, ADC control logic can evaluate a priority associatedwith the signal object that submitted the conversion request. ADCcontrol logic can evaluate the priority of the signal object thatsubmitted the conversion request, for example, accessing the signalobject's priority register, such as priority register 625 of FIG. 6A.Alternatively, a signal object can transmit a priority indication to ADCcontrol logic along with a conversion request. Based on the priority ofthe signal object that submitted the conversion request, ADC determineswhere in an active queue, such as active queue 1012 of FIG. 10, toinsert the conversion request. ADC control logic can add the conversionrequest to the active queue at operation 1150. The process illustratedby FIG. 11 ends at end operation 1199.

FIG. 12A is a block diagram that illustrates relevant components of anexample ADC system, according to one embodiment. As shown, FIG. 12Aincludes a sample module 1220 for each analog input pin. Each samplemodule 1220 is coupled to an analog input source 1210 and control logic,such as ADC control logic 1010 of FIG. 10. The control logic canindicate that the sample module 1220 should sample an analog input valuefrom the analog input source 1210 to which the sample module 1220 iscoupled. Multiplexer 1215 can receive one or more control signalsindicating that an analog input value should be transmitted from asample module 1220 to a sample module 1230 on the output of multiplexer1215. The analog input value can be stored in the sample module 1230until read and converted to a digital representation of the analog inputvalue by one of ADCs 1225.

FIG. 12B is a block diagram that illustrates relevant components of anexample sample module, such as sample module 1220, according to oneembodiment. As shown, the example sample module 1220 of FIG. 12Bincludes switches 1245 and 1255 and a capacitor 1265. Switch 1245 iscoupled to Vin, which is coupled to an analog input source, such asanalog input source 1210 of FIG. 12A. When switch 1245 is closed andswitch 1255 is open, a voltage (which represents an analog input value)present at Vin can charge capacitor 1265. Switch 1245 can be closed, forexample, in response to sample module 1220 receiving a control signal,for example a control signal sent by ADC control logic 1010 of FIG. 10.

If switch 1245 is opened after being charged to an analog input valuetransmitted by analog input source 1210, the analog input value isstored (held) in capacitor 1265. If, while switch 1245 is opened, switch1255 is closed, the analog input value stored in capacitor 1265 istransmitted to Vout.

FIG. 13A is a timing diagram that illustrates relevant aspects of theoperation of an ADC system, according to one embodiment. FIG. 13Aillustrates a sample and convert cycle for an ADC system such as ADCsystem 1010 of FIG. 10. FIG. 13A shows that at time t0, four conversionrequests P1, P2, P3, and P4 are detected by ADC control logic. It willbe assumed for the purpose of this example only that each of conversionrequests P1-P4 corresponds to a separate analog input pin and that eachof the four analog input pins is assigned to the same ADC. Theconversion requests are detected, for example, as a result of triggersoccurring in each of four signal objects. In one embodiment, when atrigger occurs that is identified in a given signal object, a conversionrequest pending flag in the signal object can be set.

Conversion request P1 is processed between time t1 and t2. That is, ananalog input value is sampled at point S1 (e.g., by a sample module 1020of FIG. 10), converted at point C1 (e.g., by an ADC 1025), and writtenat point W1 (e.g., to a signal object 1035's result buffer). At time t2,once conversion request P1 has been processed, conversion request P2 canbe processed. Though conversion request P2 occurred at time t1, sincethe ADC and sample module to which P1 is assigned were busy processingconversion request P1 until time t2, conversion request P2 is delayed.L1 represents the delay between the time conversion request P1 occurredand the time the ADC system begins processing conversion request P1.This delay is the latency between occurrence and processing ofconversion request P2. Since each of P1, P2, P3, and P4 must beprocessed by a single sample and hold circuit and ADC, only oneconversion request can be processed at one time and the others must bedelayed.

Conversion request P2 is processed between time t2 and t3. That is, ananalog input value is sampled at point S2 (e.g., by a sample module 1020of FIG. 10), converted at point C2 (e.g., by an ADC 1025), and writtenat point W2 (e.g., to a signal object 1035's result buffer).

Conversion request P3 is processed between time t3 and t4. That is, ananalog input value is sampled at point S3 (e.g., by a sample module 1020of FIG. 10), converted at point C3 (e.g., by an ADC 1025), and writtenat point W3 (e.g., to a signal object 1035's result buffer).

Conversion request P4 is processed after t4. That is, an analog inputvalue is sampled at point S4 (e.g., by a sample module 1020 of FIG. 10),converted at point C4 (e.g., by an ADC 1025), and written at point W4(e.g., to a signal object 1035's result buffer).

FIG. 13B is a timing diagram that illustrates relevant aspects of theoperation of an ADC system, according to one embodiment. FIG. 13Billustrates the operation of an ADC system that includes dedicatedsample and hold circuits for each of the ADC system's analog input pins,as shown in FIG. 12A. FIG. 13B shows that at time t0, four conversionrequests Pl, P2, P3, and P4 are detected. It will be assumed for thepurpose of this example only that each of conversion requests P1-P4corresponds to a separate analog input pin and that each of the fouranalog input pins is assigned to the same ADC. The conversion requestsare detected, for example, as a result of triggers occurring in each offour signal objects.

Each of the analog input pins that corresponds to the conversionrequests P1-P4 is sampled at time t1. Conversion and write operationsfor P1 can proceed immediately following sampling P1. Conversion andwrite operations for P2 begin at t2, after a delay of D1. Conversion andwrite operations for P3 begin at t3, after a delay of D2. Conversion andwrite operations for P4 begin at t3, after a delay of D3.

FIG. 14 is a flow diagram that illustrates relevant aspects of theoperation of an ADC system, according to one embodiment. The processillustrated by FIG. 14 starts at a start operation 1400. At operation1410, ADC control logic, such as ADC control logic 1010 of FIG. 10detects that a signal object requires processing. That is, ADC controllogic detects that an analog input value should be sampled from ananalog input pin associated with one of the ADC system's signal objects.

Once ADC control logic detects a signal object needs processing, the ADCcontrol logic sends a control signal to a sample module, such as samplemodule 1220 of FIG. 12. When the sample module receives the controlsignal, the sample module can sample an analog input value at operation1420. The sample module samples the analog input value from an analoginput pin to which the sample module is coupled.

Next, at operation 1430, ADC control logic determines whether an ADC,such as ADC 1225 of FIG. 12, is available to convert the analog inputvalue being held in the sample module. If no ADC is available, e.g., allthe ADC system's ADCs are busy converting other analog input values, theprocess loops. Once an ADC is available, ADC control logic can send acontrol signal to the sample module. In response to receiving thecontrol signal, the sample module can transmit, at operation 1440, theheld analog input value to an ADC. In order to transmit the held value,the sample module can close a switch, such as switch 1255 of FIG. 12B,coupled to an output of the sample module. The output of the samplemodule, as shown in FIG. 12A, is coupled to an input pin of amultiplexer 1215.

As shown in FIG. 12A, the ADC system's sample modules are coupled to anADC via a multiplexer and another sample module, such as one of samplemodules 1230. In addition to each input of the multiplexer having adedicated sample module, each ADC in the system has a sample modulecoupled to the ADC input. Concurrently with sending a signal to a samplemodule to transmit the held analog input value, the ADC control logiccan send a control signal to the multiplexer such that the analog inputvalue on the desired input pin of the multiplexer is transmitted to theADC. The process illustrated by FIG. 14 ends at end operation 1499.

Although the present invention has been described in connection withseveral embodiments, the invention is not intended to be limited to thespecific forms set forth herein. On the contrary, it is intended tocover such alternatives, modifications, and equivalents as can bereasonably included within the scope of the invention as defined by theappended claims.

1. A method comprising: in response to a first event: transmitting afirst value from a first input of a multiplexer to a firstanalog-to-digital converter (ADC) of a plurality of ADCs, wherein thefirst value is transmitted to only one ADC; and in response to a secondevent: transmitting a second value from the first input of themultiplexer to a second ADC of the plurality of ADCs, wherein the secondvalue is transmitted to only one ADC.
 2. The method of claim 1, furthercomprising: in response to a third event: transmitting a third valuefrom the first input of the multiplexer to the first ADC of theplurality of ADCs.
 3. The method of claim 1, further comprising: readinga flag, wherein the flag indicates whether a conversion request ispending; if the flag indicates a conversion request is pending, adding afirst conversion request to a queue and clearing the flag.
 4. The methodof claim 3, wherein the first conversion request identifies: a pin; anda priority associated with the pin.
 5. The method of claim 1, furthercomprising: accessing a first conversion request.
 6. The method of claim1, further comprising: detecting the first ADC's utilization; anddetecting the second ADC's utilization.
 7. The method of claim 1,further comprising: reading a flag, wherein the flag indicates whether asample window is open.
 8. The method of claim 1, further comprising:receiving a first control signal, wherein the first control signalspecifies the first input to the multiplexer, and the first controlsignal specifies an output, wherein the output corresponds to the firstADC of the plurality of ADCs.
 9. The method of claim 1, furthercomprising: including an additional ADC in the plurality of ADCs. 10.The method of claim 9, further comprising: transmitting a third valuefrom the first input of the multiplexer to the additional ADC.
 11. Anapparatus comprising: a multiplexer; and a control circuit, wherein thecontrol circuit is configured to initiate transmission of a first valuefrom a first input of the multiplexer to a first analog-to-digitalconverter (ADC) of a plurality of ADCs, in response to a first event,wherein the transmission of the first value is to only one ADC, andinitiate transmission of a second value from the first input of themultiplexer to a second ADC of the plurality of ADCs in response to asecond event, wherein the transmission of the second value is to onlyone ADC.
 12. The apparatus of claim 11, wherein the control circuit isfurther configured to initiate transmission of a third value from thefirst input of the multiplexer to the first ADC of the plurality ofADCs.
 13. The apparatus of claim 11, further comprising: a memory,wherein the memory is configured to store a flag, the flag is configuredto indicate whether a conversion request is pending, the control circuitis configured to access the memory and determine whether the flagindicates a conversion request is pending; a queue configured to storeat least one conversion request, wherein the control circuit isconfigured to add a first conversion request to the queue in response todetermining that the flag indicates a conversion request is pending. 14.The apparatus of claim 13, wherein the first conversion requestidentifies: a pin; and a priority associated with the pin.
 15. Theapparatus of claim 11, wherein the control circuit is further configuredto access a first conversion request.
 16. The apparatus of claim 11,wherein the control circuit is further configured to: detect the firstADC's utilization; and detect the second ADC's utilization.
 17. Theapparatus of claim 11, wherein the control circuit is further configuredto: read a flag, wherein the flag is configured to indicate whether asample window is open.
 18. The apparatus of claim 11, wherein thecontrol circuit is further configured to: specify the first input to themultiplexer, and specify an output, wherein the output corresponds tothe first ADC of the plurality of ADCs.
 19. The apparatus of claim 11,wherein the control circuit is further configured to: detect aninclusion of an additional ADC in the plurality of ADCs.
 20. Theapparatus of claim 19, wherein the control circuit is further configuredto: initiate transmission of a third value from the first input of themultiplexer to the additional ADC.
 21. A system comprising: a means fortransmitting a first value from a first input of a multiplexer to afirst analog-to-digital converter (ADC) of a plurality of ADCs inresponse to a first event, wherein the first value is transmitted toonly one ADC; and a means for transmitting a second value from the firstinput of the multiplexer to a second ADC of the plurality of ADCs inresponse to a second event, wherein the second value is transmitted toonly one ADC.